package cn.dc406.labc406mgr.mapper;

import cn.dc406.labc406mgr.entity.Users;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface UsersWapper {
    @Select("select * from users")
    List<Users> selectAllUser();

    @Select("select * from users where username=#{username}")
    List<Users> selectUserbyUsername(String username);
    @Update("update users set username=#{username},password=#{password},auth=#{auth} where username=#{oldusername}")
    Boolean updatebyUsername(Users users);

    @Delete("delete from users where username=#{username}")
    Boolean deleteItem(String username);

    @Insert("insert into users values(#{username},#{password},#{auth})")
    Boolean addUser(Users user);

}
